<!DOCTYPE html>
<html>

<head>
	<title>onlineApplyDetail.html</title>
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="this is my page">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" href="../../../plugins/bootstrap/css/bootstrap.min.css" type="text/css">
	</link>
	<link rel="shortcut icon" href="../../../plugins/FlatUI/dist/img/favicon.ico">
	<link rel="stylesheet" href="../../../css/style.css">
	<script type="text/javascript" src="../../../js/jquery.js"></script>
	<script type="text/javascript" src="../../../plugins/FlatUI/dist/js/flat-ui.js"></script>

	<script type="text/javascript" src="../../../js/base.js"></script>
	<script src="../../../js/template.js"></script>
	<script src="../../../js/bootstrap-paginator.js"></script>
	<script src="../../../js/bootstrap-mypaginator.js"></script>
	<script type="text/javascript">
		var productName = sessionStorage.getItem('productName');
		console.log(productName + "#productName");

		window.pname = productName;
		//分页查询
		function ajaxLoadData(data) {
			$.ajax({
				url: commonurl + "/selectByProductId.apply",
				type: "POST",
				data: data,
				dataType: "json",
				success: function (data) {
					if (data.success) {
						obj = data.obj;
						obj.list.forEach(function (value, index) {

							value.applyDate = new Date(value.applyDate);
							value.applyDate = value.applyDate.getFullYear() + "年" + (value.applyDate.getMonth() + 1) + "月" + value.applyDate.getDate() + "日 " + value.applyDate.getHours() + "点" + value.applyDate.getMinutes() + "分" + value.applyDate.getSeconds() + "秒";
						})
						var datas = {
							sources: obj.list,
							commonurlimg: commonurlimg,
							pname: pname
						};
						$("#applyContent").html(template("applyTemplate", datas));
						/* 	obj.list.forEach(function(value,index){
								if(value.status==-1){
										$("."+value.id).html("已删除");
										$("#"+value.id).html("");
								}
							}) */
						myPaginatorFun("myPages", obj.pageNo, obj.pages);
					} else {
						alert(data.msg);
					}
				}

			})
		}


		$(function () {

			var productId = sessionStorage.getItem('productId');
			// var productName = sessionStorage.getItem('productName');
			//console.log(productName+"#productName");

			//window.productName=productName; 

			//刚进页面加载数据
			ajaxLoadData({
				pageNo: 1,
				productId: productId
			});
			myoptions.onPageClicked = function (event, originalEvent, type, page) {
				ajaxLoadData({
					pageNo: page,
					productId: productId
				});
			};
		})


	</script>

</head>

<body style="padding: 5px 10px">

	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title">在线申请详情</h3>
		</div>
		<div class="panel-body">
			<table class="table table-hover">
				<thead>
					<tr>
						<th>产品名称</th>
						<th>申请人</th>
						<th>申请数额</th>
						<th>申请日期</th>
						<th>身份证号</th>
					</tr>
				</thead>
				<tbody id="applyContent">
					<script id="applyTemplate" type="text/html">
	  			{{each sources as i}}
		  			<tr> 	 	 	 	 	 
		  				<td>{{pname}}</td>
		  				<td>{{i.applyPerson}}</td>
		  				<td>{{i.applyNum}}万</td>
		  				<td>{{i.applyDate}}</td>
		  				<td>{{i.applyIDCard}}</td>
		  			</tr>
                 {{/each}}
                  </script>
				</tbody>
			</table>
		</div>
	</div>
	<div style="text-align: center;">
		<ul id="myPages"></ul>
	</div>

</body>

</html>